package au.com.handsunited.model;

import java.util.ArrayList;
import java.util.List;

import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Index;
import org.hibernate.search.annotations.Indexed;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


/**
 *
 * @author Arun Chandrasekhar
 */
@Indexed
public class Address {

	private String number;
	private String street;
	@Field(index=Index.TOKENIZED)
	private String suburb;
	@Field(index=Index.TOKENIZED)
	private String city;
	@Field(index=Index.TOKENIZED)
	private String state;
	private String postcode;
	@Field(index=Index.TOKENIZED)
	private String country;


	public static final List<String> COUNTRIES = new ArrayList<String>();
	public static final List<String> STATES = new ArrayList<String>();


	private static Logger logger = LoggerFactory.getLogger(Address.class);

	/**
	 *
	 */
	public Address() {
		super();
	}


	/**
	 *
	 * @param number
	 * @param street
	 * @param suburb
	 * @param city
	 * @param state
	 * @param postcode
	 * @param country
	 */
	public Address(String number, String street, String suburb, String city,
			String state, String postcode, String country) {

		this();
		this.number = number;
		this.street = street;
		this.suburb = suburb;
		this.city = city;
		this.state = state;
		this.postcode = postcode;
		this.country = country;
	}


	/**
	 * @return the city
	 */
	public String getCity() {
		return city;
	}

	/**
	 * @param city the city to set
	 */
	public void setCity(String city) {
		this.city = city;
	}

	/**
	 * @return the country
	 */
	public String getCountry() {
		return country;
	}

	/**
	 * @param country the country to set
	 */
	public void setCountry(String country) {
		this.country = country;
	}

	/**
	 * @return the number
	 */
	public String getNumber() {
		return number;
	}

	/**
	 * @param number the number to set
	 */
	public void setNumber(String number) {
		this.number = number;
	}

	/**
	 * @return the postcode
	 */
	public String getPostcode() {
		return postcode;
	}

	/**
	 * @param postcode the postcode to set
	 */
	public void setPostcode(String postcode) {
		this.postcode = postcode;
	}

	/**
	 * @return the state
	 */
	public String getState() {
		return state;
	}

	/**
	 * @param state the state to set
	 */
	public void setState(String state) {
		this.state = state;
	}

	/**
	 * @return the street
	 */
	public String getStreet() {
		return street;
	}

	/**
	 * @param street the street to set
	 */
	public void setStreet(String street) {
		this.street = street;
	}

	/**
	 * @return the suburb
	 */
	public String getSuburb() {
		return suburb;
	}

	/**
	 * @param suburb the suburb to set
	 */
	public void setSuburb(String suburb) {
		this.suburb = suburb;
	}

	/**
	 * Constructs a <code>String</code> with all attributes
	 * in name = value format.
	 *
	 * @return a <code>String</code> representation
	 * of this object.
	 */
	@Override
	public String toString()
	{
	    final String TAB = "    ";

	    StringBuffer retValue = new StringBuffer();

	    retValue.append("Address ( ")
	        .append(super.toString()).append(TAB)
	        .append("number = ").append(number).append(TAB)
	        .append("street = ").append(street).append(TAB)
	        .append("suburb = ").append(suburb).append(TAB)
	        .append("city = ").append(city).append(TAB)
	        .append("state = ").append(state).append(TAB)
	        .append("postcode = ").append(postcode).append(TAB)
	        .append("country = ").append(country).append(TAB)
	        .append(" )");

	    return retValue.toString();
	}


	static {
		Address.STATES.add("WA");
		Address.STATES.add("WA");
		Address.STATES.add("NT");
		Address.STATES.add("SA");
		Address.STATES.add("QLD");
		Address.STATES.add("NSW");
		Address.STATES.add("ACT");
		Address.STATES.add("VIC");
		Address.STATES.add("TAS");


		Address.COUNTRIES.add("Afghanistan");
		Address.COUNTRIES.add("Albania");
		Address.COUNTRIES.add("Algeria");
		Address.COUNTRIES.add("American Samoa");
		Address.COUNTRIES.add("Andorra");
		Address.COUNTRIES.add("Angola");
		Address.COUNTRIES.add("Anguilla");
		Address.COUNTRIES.add("Antarctica");
		Address.COUNTRIES.add("Antigua And Barbuda");
		Address.COUNTRIES.add("Argentina");
		Address.COUNTRIES.add("Armenia");
		Address.COUNTRIES.add("Aruba");
		Address.COUNTRIES.add("Australia");
		Address.COUNTRIES.add("Austria");
		Address.COUNTRIES.add("Azerbaijan");
		Address.COUNTRIES.add("Bahamas");
		Address.COUNTRIES.add("Bahrain");
		Address.COUNTRIES.add("Bangladesh");
		Address.COUNTRIES.add("Barbados");
		Address.COUNTRIES.add("Belarus");
		Address.COUNTRIES.add("Belgium");
		Address.COUNTRIES.add("Belize");
		Address.COUNTRIES.add("Benin");
		Address.COUNTRIES.add("Bermuda");
		Address.COUNTRIES.add("Bhutan");
		Address.COUNTRIES.add("Bolivia");
		Address.COUNTRIES.add("Bosnia And Herzegowina");
		Address.COUNTRIES.add("Botswana");
		Address.COUNTRIES.add("Bouvet Island");
		Address.COUNTRIES.add("Brazil");
		Address.COUNTRIES.add("British Indian Ocean Territory");
		Address.COUNTRIES.add("Brunei Darussalam");
		Address.COUNTRIES.add("Bulgaria");
		Address.COUNTRIES.add("Burkina Faso");
		Address.COUNTRIES.add("Burundi");
		Address.COUNTRIES.add("Cambodia");
		Address.COUNTRIES.add("Cameroon");
		Address.COUNTRIES.add("Canada");
		Address.COUNTRIES.add("Cape Verde");
		Address.COUNTRIES.add("Cayman Islands");
		Address.COUNTRIES.add("Central African Republic");
		Address.COUNTRIES.add("Chad");
		Address.COUNTRIES.add("Chile");
		Address.COUNTRIES.add("China");
		Address.COUNTRIES.add("Christmas Island");
		Address.COUNTRIES.add("Cocos (Keeling) Islands");
		Address.COUNTRIES.add("Colombia");
		Address.COUNTRIES.add("Comoros");
		Address.COUNTRIES.add("Congo");
		Address.COUNTRIES.add("Cook Islands");
		Address.COUNTRIES.add("Costa Rica");
		Address.COUNTRIES.add("Cote D'Ivoire");
		Address.COUNTRIES.add("Croatia");
		Address.COUNTRIES.add("Cuba");
		Address.COUNTRIES.add("Cyprus");
		Address.COUNTRIES.add("Czech Republic");
		Address.COUNTRIES.add("Denmark");
		Address.COUNTRIES.add("Djibouti");
		Address.COUNTRIES.add("Dominica");
		Address.COUNTRIES.add("Dominican Republic");
		Address.COUNTRIES.add("East Timor");
		Address.COUNTRIES.add("Ecuador");
		Address.COUNTRIES.add("Egypt");
		Address.COUNTRIES.add("El Salvador");
		Address.COUNTRIES.add("Equatorial Guinea");
		Address.COUNTRIES.add("Eritrea");
		Address.COUNTRIES.add("Estonia");
		Address.COUNTRIES.add("Ethiopia");
		Address.COUNTRIES.add("Falkland Islands (Malvinas)");
		Address.COUNTRIES.add("Faroe Islands");
		Address.COUNTRIES.add("Fiji");
		Address.COUNTRIES.add("Finland");
		Address.COUNTRIES.add("France");
		Address.COUNTRIES.add("French Guiana");
		Address.COUNTRIES.add("French Polynesia");
		Address.COUNTRIES.add("French Southern Territories");
		Address.COUNTRIES.add("Gabon");
		Address.COUNTRIES.add("Gambia");
		Address.COUNTRIES.add("Georgia");
		Address.COUNTRIES.add("Germany");
		Address.COUNTRIES.add("Ghana");
		Address.COUNTRIES.add("Gibraltar");
		Address.COUNTRIES.add("Greece");
		Address.COUNTRIES.add("Greenland");
		Address.COUNTRIES.add("Grenada");
		Address.COUNTRIES.add("Guadeloupe");
		Address.COUNTRIES.add("Guam");
		Address.COUNTRIES.add("Guatemala");
		Address.COUNTRIES.add("Guinea");
		Address.COUNTRIES.add("Guinea-Bissau");
		Address.COUNTRIES.add("Guyana");
		Address.COUNTRIES.add("Haiti");
		Address.COUNTRIES.add("Heard And Mc Donald Islands");
		Address.COUNTRIES.add("Holy See (Vatican City State)");
		Address.COUNTRIES.add("Honduras");
		Address.COUNTRIES.add("Hong Kong");
		Address.COUNTRIES.add("Hungary");
		Address.COUNTRIES.add("Icel And");
		Address.COUNTRIES.add("India");
		Address.COUNTRIES.add("Indonesia");
		Address.COUNTRIES.add("Iran (Islamic Republic Of)");
		Address.COUNTRIES.add("Iraq");
		Address.COUNTRIES.add("Ireland");
		Address.COUNTRIES.add("Israel");
		Address.COUNTRIES.add("Italy");
		Address.COUNTRIES.add("Jamaica");
		Address.COUNTRIES.add("Japan");
		Address.COUNTRIES.add("Jordan");
		Address.COUNTRIES.add("Kazakhstan");
		Address.COUNTRIES.add("Kenya");
		Address.COUNTRIES.add("Kiribati");
		Address.COUNTRIES.add("Korea, Dem People'S Republic");
		Address.COUNTRIES.add("Korea, Republic Of");
		Address.COUNTRIES.add("Kuwait");
		Address.COUNTRIES.add("Kyrgyzstan");
		Address.COUNTRIES.add("Lao People'S Dem Republic");
		Address.COUNTRIES.add("Latvia");
		Address.COUNTRIES.add("Lebanon");
		Address.COUNTRIES.add("Lesotho");
		Address.COUNTRIES.add("Liberia");
		Address.COUNTRIES.add("Libyan Arab Jamahiriya");
		Address.COUNTRIES.add("Liechtenstein");
		Address.COUNTRIES.add("Lithuania");
		Address.COUNTRIES.add("Luxembourg");
		Address.COUNTRIES.add("Macau");
		Address.COUNTRIES.add("Macedonia");
		Address.COUNTRIES.add("Madagascar");
		Address.COUNTRIES.add("Malawi");
		Address.COUNTRIES.add("Malaysia");
		Address.COUNTRIES.add("Maldives");
		Address.COUNTRIES.add("Mali");
		Address.COUNTRIES.add("Malta");
		Address.COUNTRIES.add("Marshall Islands");
		Address.COUNTRIES.add("Martinique");
		Address.COUNTRIES.add("Mauritania");
		Address.COUNTRIES.add("Mauritius");
		Address.COUNTRIES.add("Mayotte");
		Address.COUNTRIES.add("Mexico");
		Address.COUNTRIES.add("Micronesia, Federated States");
		Address.COUNTRIES.add("Moldova, Republic Of");
		Address.COUNTRIES.add("Monaco");
		Address.COUNTRIES.add("Mongolia");
		Address.COUNTRIES.add("Montserrat");
		Address.COUNTRIES.add("Morocco");
		Address.COUNTRIES.add("Mozambique");
		Address.COUNTRIES.add("Myanmar");
		Address.COUNTRIES.add("Namibia");
		Address.COUNTRIES.add("Nauru");
		Address.COUNTRIES.add("Nepal");
		Address.COUNTRIES.add("Netherlands");
		Address.COUNTRIES.add("Netherlands Ant Illes");
		Address.COUNTRIES.add("New Caledonia");
		Address.COUNTRIES.add("New Zealand");
		Address.COUNTRIES.add("Nicaragua");
		Address.COUNTRIES.add("Niger");
		Address.COUNTRIES.add("Nigeria");
		Address.COUNTRIES.add("Niue");
		Address.COUNTRIES.add("Norfolk Island");
		Address.COUNTRIES.add("Northern Mariana Islands");
		Address.COUNTRIES.add("Norway");
		Address.COUNTRIES.add("Oman");
		Address.COUNTRIES.add("Pakistan");
		Address.COUNTRIES.add("Palau");
		Address.COUNTRIES.add("Panama");
		Address.COUNTRIES.add("Papua New Guinea");
		Address.COUNTRIES.add("Paraguay");
		Address.COUNTRIES.add("Peru");
		Address.COUNTRIES.add("Philippines");
		Address.COUNTRIES.add("Pitcairn");
		Address.COUNTRIES.add("Poland");
		Address.COUNTRIES.add("Portugal");
		Address.COUNTRIES.add("Puerto Rico");
		Address.COUNTRIES.add("Qatar");
		Address.COUNTRIES.add("Reunion");
		Address.COUNTRIES.add("Romania");
		Address.COUNTRIES.add("Russian Federation");
		Address.COUNTRIES.add("Rwanda");
		Address.COUNTRIES.add("Saint K Itts And Nevis");
		Address.COUNTRIES.add("Saint Lucia");
		Address.COUNTRIES.add("Saint Vincent, The Grenadines");
		Address.COUNTRIES.add("Samoa");
		Address.COUNTRIES.add("San Marino");
		Address.COUNTRIES.add("Sao Tome And Principe");
		Address.COUNTRIES.add("Saudi Arabia");
		Address.COUNTRIES.add("Senegal");
		Address.COUNTRIES.add("Seychelles");
		Address.COUNTRIES.add("Sierra Leone");
		Address.COUNTRIES.add("Singapore");
		Address.COUNTRIES.add("Slovakia (Slovak Republic)");
		Address.COUNTRIES.add("Slovenia");
		Address.COUNTRIES.add("Solomon Islands");
		Address.COUNTRIES.add("Somalia");
		Address.COUNTRIES.add("South Africa");
		Address.COUNTRIES.add("South Georgia , S Sandwich Is.");
		Address.COUNTRIES.add("Spain");
		Address.COUNTRIES.add("Sri Lanka");
		Address.COUNTRIES.add("St. Helena");
		Address.COUNTRIES.add("St. Pierre And Miquelon");
		Address.COUNTRIES.add("Sudan");
		Address.COUNTRIES.add("Suriname");
		Address.COUNTRIES.add("Svalbard, Jan Mayen Islands");
		Address.COUNTRIES.add("Sw Aziland");
		Address.COUNTRIES.add("Sweden");
		Address.COUNTRIES.add("Switzerland");
		Address.COUNTRIES.add("Syrian Arab Republic");
		Address.COUNTRIES.add("Taiwan");
		Address.COUNTRIES.add("Tajikistan");
		Address.COUNTRIES.add("Tanzania, United Republic Of");
		Address.COUNTRIES.add("Thailand");
		Address.COUNTRIES.add("Togo");
		Address.COUNTRIES.add("Tokelau");
		Address.COUNTRIES.add("Tonga");
		Address.COUNTRIES.add("Trinidad And Tobago");
		Address.COUNTRIES.add("Tunisia");
		Address.COUNTRIES.add("Turkey");
		Address.COUNTRIES.add("Turkmenistan");
		Address.COUNTRIES.add("Turks And Caicos Islands");
		Address.COUNTRIES.add("Tuvalu");
		Address.COUNTRIES.add("Uganda");
		Address.COUNTRIES.add("Ukraine");
		Address.COUNTRIES.add("United Arab Emirates");
		Address.COUNTRIES.add("United Kingdom");
		Address.COUNTRIES.add("United States");
		Address.COUNTRIES.add("United States Minor Is.");
		Address.COUNTRIES.add("Uruguay");
		Address.COUNTRIES.add("Uzbekistan");
		Address.COUNTRIES.add("Vanuatu");
		Address.COUNTRIES.add("Venezuela");
		Address.COUNTRIES.add("Viet Nam");
		Address.COUNTRIES.add("Virgin Islands (British)");
		Address.COUNTRIES.add("Virgin Islands (U.S.)");
		Address.COUNTRIES.add("Wallis And Futuna Islands");
		Address.COUNTRIES.add("Western Sahara");
		Address.COUNTRIES.add("Yemen");
		Address.COUNTRIES.add("Yugoslavia");
		Address.COUNTRIES.add("Zaire");
		Address.COUNTRIES.add("Zambia");
		Address.COUNTRIES.add("Zimbabwe");
	}




}
